import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from "../views/HomeView"

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    component:  () => import('../views/LoginView.vue'),

  },
  {
    path: '/',
    component:  HomeView,
    children: [
      {
        path: '/sys-admin/index',
        component: () => import('../views/sys-admin/AdminIndexView.vue')
      },
      {
        path: '/sys-admin/product/spu-management',
        component: () => import('../views/sys-admin/product/SpuManagement')
      },
      {
        path: '/sys-admin/product/spu-add-new',
        component: () => import('../views/sys-admin/product/SpuAddNew')
      }
      ,
      {
        path: '/sys-admin/product/album-management',
        component: () => import('../views/sys-admin/product/AlbumManagement')
      }
      ,
      {
        path: '/sys-admin/product/category-management',
        component: () => import('../views/sys-admin/product/CategoryManagement')
      },
      {
        path: '/sys-admin/product/attributeTemplate-management',
        component: () => import('../views/sys-admin/product/AttributeTemplateManagement')
      }
      ,
      {
        path: '/sys-admin/product/brand-management',
        component: () => import('../views/sys-admin/product/BrandManagement')
      },
      {
        path: '/sys-admin/admin/user-list',
        component: () => import('../views/sys-admin/admin/UserListView')
      },
      {
        path: '/sys-admin/admin/role-list',
        component: () => import('../views/sys-admin/admin/RoleListView')
      },
      {
        path: '/sys-admin/admin/permission-list',
        component: () => import('../views/sys-admin/admin/PermissionListView')
      }
      ,
      {
        path: '/sys-admin/temp/brand/add-new',
        component: () => import('../views/sys-admin/temp/BrandAddNewView.vue')
      },
      {
        path: '/sys-admin/temp/album/add-new',
        component: () => import('../views/sys-admin/temp/AlbumAddNewView.vue')
      },
      {
        path: '/sys-admin/temp/category/add-new',
        component: () => import('../views/sys-admin/temp/CategoryAddNewView.vue')
      },
      {
        path: '/sys-admin/temp/admin/add-new',
        component: () => import('../views/sys-admin/temp/AdminAddNewView.vue')
      }


    ]
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
